package com.zhichat.infrastructure.Enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName: ContactTypeEnum
 * @Description: 联系人类型 枚举
 * @Author: 团长九哥 https://space.bilibili.com/602197686
 * @CreateDate: 2024/11/14 22:29
 */
@Getter
@AllArgsConstructor
public enum ContactTypeEnum {
    USER(1, "用户"),
    GROUP(2, "群组");
    private final Integer code;
    private final String desc;

    public static ContactTypeEnum getEnum(Integer code) {
        for (ContactTypeEnum type : ContactTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
